import requests

# 没有headers
response = requests.get('https://www.zhihu.com/explore')
print(response.text)
"""
<html>
<head><title>400 Bad Request</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<hr><center>openresty</center>
</body>
</html>
"""


# 有headers
headrs = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2952.99 Safari/537.36'
}
# response = requests.get('http://127.0.0.1/metinfo/about', headers=headrs)
response = requests.get('https://www.zhihu.com/explore', headers=headrs)
print(response.text)
